<%
/* Copyright 2010 Assert Developments
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * 	http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<%@ page isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="f"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>

<f:setLocale value="en_US" scope="session"/>

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <title><f:message key="login.title"/></title>

        <!-- metadata -->
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

        <!-- stylesheets -->
        <link rel="stylesheet" type="text/css" href="../css/default/main.css"/>

        <!-- scripts -->
        <script type="text/javascript" src="../js/md5-min.js"></script>
        <script type="text/javascript">
          function login() {
              document.hiddenForm.email.value = document.loginForm.email.value;
              document.hiddenForm.password.value = hex_md5(document.loginForm.password.value);
              document.hiddenForm.submit();
          }
        </script>

    </head>
    <body onload="document.loginForm.email.focus();">
          <c:if test="${not empty message}">
              <f:message key="${message}"/>
          </c:if>
          <form name="loginForm" method="post" onsubmit="login(); return false;">
              <f:message key="login.email"/>&nbsp;<input type="text" name="email"/><br/>
              <f:message key="login.password"/>&nbsp;<input type="password" name="password"/></br>
              <a href="#" onclick="login();"><f:message key="login.go"/></a>
          </form>
          <form name="hiddenForm" method="post" action="login.html">
              <input type="hidden" name="email" value=""/>
              <input type="hidden" name="password" value=""/>
          </form>
    </body>
</html>